package com.fowo.api.controller.shipment.fbainvoice;

import com.fowo.api.model.fbainvoice.FBAInvoiceFinishPickingAction;
import com.fowo.api.model.fbainvoice.FBAInvoiceVo;
import com.fowo.api.service.FBAInvoiceService;
import com.fowo.api.service.impl.FBAInvoiceServiceImpl;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

@Component()
public class fbaInvoiceFinishPickingAction implements FBAInvoiceFinishPickingAction {

    @Resource
    private FBAInvoiceServiceImpl FBAInvoiceService;
    @Override
    public void run(List<Long> idList) throws Exception {
        for(int i=0;i<idList.size();i++){
            handle(idList.get(i));
        }
    }

    private void handle(Long aLong) throws Exception {

        FBAInvoiceVo voById = FBAInvoiceService.getVoById(aLong);
        //isPick
        voById.setIsPick("1");
        FBAInvoiceService.update(voById);
    }
}
